package com.coin.controller;

import com.coin.model.LoginResult;
import com.coin.service.*;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther: 李 力
 * @Date: 2025/5/26
 * @Description: com.coin.controller
 * @version: 1.0
 */
@RestController
@RequestMapping
@Api(tags = "登录的控制器")
public class SysLoginController {

    @Autowired
    private SysLoginService loginService;

    @PostMapping("/login")
    @ApiOperation(value = "后台管理人员登录")
    @ApiImplicitParams(
            {
                    @ApiImplicitParam(name = "username", value = "用户名称"),
                    @ApiImplicitParam(name = "password", value = "用户的密码"),
            }
    )
    public LoginResult login(
            @RequestParam(required = true) String username,
            @RequestParam(required = true) String password
    ) {
        return loginService.login(username, password);
    }
}
